﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyBlog.Model;

namespace MyBlog.WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    
    public class TestController : ControllerBase
    {
        [HttpGet("NOAuthorize")]
        public TypeInfo NOAuthorize()
        {
            TypeInfo t = new TypeInfo()
            {
                Name = "测试",
                Id = 1
            };
            return t;
        }

        [HttpGet("Authorize")]
        [Authorize]
        public string Authorize()
        {
            return "this is a Authorize";
        }
    }
    
}
